#ifndef __MARS_GRAPHICS_MESH_H__
#define __MARS_GRAPHICS_MESH_H__

#include "MarsType.h"
#include "MarsComponent.h"


namespace Graphics
{

class VertexData;

class Mesh : public Object
{
public:
									Mesh();
	virtual							~Mesh();

	virtual bool					Load();
	virtual void					Unload();

	VertexData*						GetVertexData();
	Core::uint32					GetVertexCount() const;
	Core::uint32					GetStride() const;
	Core::uint32					GetOffset() const;
	D3D_PRIMITIVE_TOPOLOGY			GetTopology() const;

protected:
	VertexData*						m_pVertexData;
	D3D_PRIMITIVE_TOPOLOGY			m_eTopology;

	Core::uint32					m_iVertexCount;
	Core::uint32					m_iStride;
	Core::uint32					m_iOffset;
};

inline Mesh::Mesh()
	: m_pVertexData( NULL )
	, m_eTopology( D3D_PRIMITIVE_TOPOLOGY_UNDEFINED )
	, m_iVertexCount( 0 )
	, m_iStride( 0 )
	, m_iOffset( 0 )
{

}

inline Mesh::~Mesh()
{
	Unload();
}

inline VertexData* Mesh::GetVertexData()
{
	return m_pVertexData;
}

inline Core::uint32 Mesh::GetVertexCount() const
{
	return m_iVertexCount;
}

inline Core::uint32 Mesh::GetStride() const
{
	return m_iStride;
}

inline Core::uint32 Mesh::GetOffset() const
{
	return m_iOffset;
}

inline D3D_PRIMITIVE_TOPOLOGY Mesh::GetTopology() const
{
	return m_eTopology;
}

} // end of namespace Graphics

#endif // end of #ifndef __MARS_GRAPHICS_MESH_H__